//package com.qf.web.config;
//
//import org.springframework.stereotype.Component;
//
//import javax.servlet.*;
//import javax.servlet.http.HttpServletResponse;
//import java.io.IOException;
//
//@Component
//public class CorsFilter implements Filter {
//    @Override
//    public void init(FilterConfig filterConfig) throws ServletException {
//
//    }
//
//    @Override
//    public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
//        HttpServletResponse res = (HttpServletResponse) servletResponse;
//        res.setHeader("Access-Control-Allow-Credentials", "true");
//        res.setHeader("Access-Control-Allow-Origin", "*");
//        res.setHeader("Access-Control-Allow-Methods", "GET, POST, DELETE, PUT, OPTIONS");
//        res.setHeader("Access-Control-Max-Age", "3600");
//        res.setHeader("Access-Control-Allow-Headers", "Origin, X-requested-With, Content-Type, Accept");
//        res.setHeader("Access-Control-Expose-Headers", "Location");
//
////        res.addHeader("Access-Control-Allow-Credentials", "true");
////        res.addHeader("Access-Control-Allow-Origin", "*");
////        res.addHeader("Access-Control-Allow-Methods", "GET, POST, DELETE, PUT, OPTIONS");
////        res.addHeader("Access-Control-Max-Age", "3600");
////        res.addHeader("Access-Control-Allow-Headers", "Origin, X-requested-With, Content-Type, Accept");
////        res.addHeader("Access-Control-Expose-Headers", "Location");
//        filterChain.doFilter(servletRequest,servletResponse);
//    }
//
//    @Override
//    public void destroy() {
//
//    }
//}
